package corej.course.collection.set;

import java.util.*;

public class TestSetSort {
    @SuppressWarnings("unchecked")
    public static void main(String[] argfs) {
        Set s = new HashSet();
        s.add("Huxz");
        s.add("Liucy");
        s.add("Liuxf");
        s.add("Hiloo");

        /*
           * Set s2=new TreeSet(); s2.addAll(s); print(s2);
           */
        List list = new ArrayList();
        list.addAll(s);
        Collections.sort(list);
        print(list);

    }

    public static void print(Collection c) {
        Iterator it = c.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
    }
}
